
***xlabel prep: different per application

if "$EXP"=="OHIE" {

replace groupstr="hh.size 1 & draw 1 & no prior visit" 	if groupstr=="drawdraw_lo_1&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 1 & prior visit" 	if groupstr=="drawdraw_lo_1&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 1 & no prior visit" 	if groupstr=="drawdraw_lo_1&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 1 & prior visit" 	if groupstr=="drawdraw_lo_1&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 1 & no prior visit" 	if groupstr=="drawdraw_lo_1&hhnumhh_lis_3&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 2 & no prior visit" 	if groupstr=="drawdraw_lo_2&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 2 & prior visit" 	if groupstr=="drawdraw_lo_2&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 2 & no prior visit" 	if groupstr=="drawdraw_lo_2&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 2 & prior visit" 	if groupstr=="drawdraw_lo_2&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 2 & no prior visit" 	if groupstr=="drawdraw_lo_2&hhnumhh_lis_3&preperiod_any_visits_0=1"
replace groupstr="hh.size 3 & draw 2 & prior visit" 	if groupstr=="drawdraw_lo_2&hhnumhh_lis_3&preperiod_any_visits_1=1"
replace groupstr="hh.size 1 & draw 3 & no prior visit" 	if groupstr=="drawdraw_lo_3&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 3 & prior visit" 	if groupstr=="drawdraw_lo_3&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 3 & no prior visit" 	if groupstr=="drawdraw_lo_3&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 3 & prior visit" 	if groupstr=="drawdraw_lo_3&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 3 & no prior visit" 	if groupstr=="drawdraw_lo_3&hhnumhh_lis_3&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 4 & no prior visit" 	if groupstr=="drawdraw_lo_4&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 4 & prior visit" 	if groupstr=="drawdraw_lo_4&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 4 & no prior visit" 	if groupstr=="drawdraw_lo_4&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 4 & prior visit" 	if groupstr=="drawdraw_lo_4&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 4 & no prior visit" 	if groupstr=="drawdraw_lo_4&hhnumhh_lis_3&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 5 & no prior visit" 	if groupstr=="drawdraw_lo_5&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 5 & prior visit" 	if groupstr=="drawdraw_lo_5&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 5 & no prior visit" 	if groupstr=="drawdraw_lo_5&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 5 & prior visit" 	if groupstr=="drawdraw_lo_5&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 1 & draw 6 & no prior visit" 	if groupstr=="drawdraw_lo_6&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 6 & prior visit" 	if groupstr=="drawdraw_lo_6&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 6 & no prior visit" 	if groupstr=="drawdraw_lo_6&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 6 & prior visit" 	if groupstr=="drawdraw_lo_6&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 6 & no prior visit" 	if groupstr=="drawdraw_lo_6&hhnumhh_lis_3&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 7 & no prior visit" 	if groupstr=="drawdraw_lo_7&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 7 & prior visit" 	if groupstr=="drawdraw_lo_7&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 7 & no prior visit" 	if groupstr=="drawdraw_lo_7&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 7 & prior visit" 	if groupstr=="drawdraw_lo_7&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 7 & no prior visit" 	if groupstr=="drawdraw_lo_7&hhnumhh_lis_3&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 8 & no prior visit" 	if groupstr=="drawdraw_lo_8&hhnumhh_lis_1&preperiod_any_visits_0=1"
replace groupstr="hh.size 1 & draw 8 & prior visit" 	if groupstr=="drawdraw_lo_8&hhnumhh_lis_1&preperiod_any_visits_1=1"
replace groupstr="hh.size 2 & draw 8 & no prior visit" 	if groupstr=="drawdraw_lo_8&hhnumhh_lis_2&preperiod_any_visits_0=1"
replace groupstr="hh.size 2 & draw 8 & prior visit" 	if groupstr=="drawdraw_lo_8&hhnumhh_lis_2&preperiod_any_visits_1=1"
replace groupstr="hh.size 3 & draw 8 & no prior visit" 	if groupstr=="drawdraw_lo_8&hhnumhh_lis_3&preperiod_any_visits_0=1"	
}

if "$EXP"=="LinkedIn" {
	
replace groupstr="Cohort-pair 1"  if groupstr=="stratum1&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 2"  if groupstr=="stratum2&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 3"  if groupstr=="stratum3&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 4"  if groupstr=="stratum4&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 5"  if groupstr=="stratum5&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 6"  if groupstr=="stratum6&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 7"  if groupstr=="stratum7&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 8"  if groupstr=="stratum8&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 9"  if groupstr=="stratum9&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 10" if groupstr=="stratum10&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 11" if groupstr=="stratum11&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 12" if groupstr=="stratum12&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 13" if groupstr=="stratum13&everyonex2&everyonex3=1"
replace groupstr="Cohort-pair 14" if groupstr=="stratum14&everyonex2&everyonex3=1"
	
}

if "$EXP"=="Elite" {

replace groupstr="appl.year 1995 & female" 				if groupstr=="test_id_1&female&everyonex3=1"
replace groupstr="appl.year 1995 & male" 				if groupstr=="test_id_1&male&everyonex3=1"
replace groupstr="appl.year 1995 & house blw.med." 		if groupstr=="test_id_1&house_belmed&everyonex3=1"
replace groupstr="appl.year 1995 & house abv.med." 		if groupstr=="test_id_1&house_abvmed&everyonex3=1"
replace groupstr="appl.year 1995 & no commuter" 		if groupstr=="test_id_1&commuter_0&everyonex3=1"
replace groupstr="appl.year 1995 & commuter" 			if groupstr=="test_id_1&commuter_1&everyonex3=1"
replace groupstr="appl.year 1995 & not enr.2005" 		if groupstr=="test_id_1&enr2005_0&everyonex3=1"
replace groupstr="appl.year 1995 & enr.2005" 			if groupstr=="test_id_1&enr2005_1&everyonex3=1"
replace groupstr="appl.year 1996 & female" 				if groupstr=="test_id_2&female&everyonex3=1"
replace groupstr="appl.year 1996 & male" 				if groupstr=="test_id_2&male&everyonex3=1"
replace groupstr="appl.year 1996 & house blw.med." 		if groupstr=="test_id_2&house_belmed&everyonex3=1"
replace groupstr="appl.year 1996 & house abv.med." 		if groupstr=="test_id_2&house_abvmed&everyonex3=1"
replace groupstr="appl.year 1996 & no commuter" 		if groupstr=="test_id_2&commuter_0&everyonex3=1"
replace groupstr="appl.year 1996 & commuter" 			if groupstr=="test_id_2&commuter_1&everyonex3=1"
replace groupstr="appl.year 1996 & not enr.2005" 		if groupstr=="test_id_2&enr2005_0&everyonex3=1"
replace groupstr="appl.year 1996 & enr.2005" 			if groupstr=="test_id_2&enr2005_1&everyonex3=1"
replace groupstr="appl.year 1997 & female" 				if groupstr=="test_id_3&female&everyonex3=1"
replace groupstr="appl.year 1997 & male" 				if groupstr=="test_id_3&male&everyonex3=1"
replace groupstr="appl.year 1997 & house blw.med." 		if groupstr=="test_id_3&house_belmed&everyonex3=1"
replace groupstr="appl.year 1997 & house abv.med." 		if groupstr=="test_id_3&house_abvmed&everyonex3=1"
replace groupstr="appl.year 1997 & no commuter" 		if groupstr=="test_id_3&commuter_0&everyonex3=1"
replace groupstr="appl.year 1997 & commuter" 			if groupstr=="test_id_3&commuter_1&everyonex3=1"
replace groupstr="appl.year 1997 & not enr.2005" 		if groupstr=="test_id_3&enr2005_0&everyonex3=1"
replace groupstr="appl.year 1997 & enr.2005" 			if groupstr=="test_id_3&enr2005_1&everyonex3=1"
replace groupstr="appl.year 1998 & female" 				if groupstr=="test_id_4&female&everyonex3=1"
replace groupstr="appl.year 1998 & male" 				if groupstr=="test_id_4&male&everyonex3=1"
replace groupstr="appl.year 1998 & house blw.med." 		if groupstr=="test_id_4&house_belmed&everyonex3=1"
replace groupstr="appl.year 1998 & house abv.med." 		if groupstr=="test_id_4&house_abvmed&everyonex3=1"
replace groupstr="appl.year 1998 & no commuter" 		if groupstr=="test_id_4&commuter_0&everyonex3=1"
replace groupstr="appl.year 1998 & commuter" 			if groupstr=="test_id_4&commuter_1&everyonex3=1"
replace groupstr="appl.year 1998 & not enr.2005" 		if groupstr=="test_id_4&enr2005_0&everyonex3=1"
replace groupstr="appl.year 1999 & enr.2005" 			if groupstr=="test_id_4&enr2005_1&everyonex3=1"
replace groupstr="appl.year 1999 & female" 				if groupstr=="test_id_5&female&everyonex3=1"
replace groupstr="appl.year 1999 & male" 				if groupstr=="test_id_5&male&everyonex3=1"
replace groupstr="appl.year 1999 & house blw.med." 		if groupstr=="test_id_5&house_belmed&everyonex3=1"
replace groupstr="appl.year 1999 & house abv.med." 		if groupstr=="test_id_5&house_abvmed&everyonex3=1"
replace groupstr="appl.year 1999 & no commuter" 		if groupstr=="test_id_5&commuter_0&everyonex3=1"
replace groupstr="appl.year 1999 & commuter" 			if groupstr=="test_id_5&commuter_1&everyonex3=1"
replace groupstr="appl.year 1999 & not enr.2005" 		if groupstr=="test_id_5&enr2005_0&everyonex3=1"
replace groupstr="appl.year 1999 & enr.2005" 			if groupstr=="test_id_5&enr2005_1&everyonex3=1"
replace groupstr="appl.year 2000 & female" 				if groupstr=="test_id_6&female&everyonex3=1"
replace groupstr="appl.year 2000 & male" 				if groupstr=="test_id_6&male&everyonex3=1"
replace groupstr="appl.year 2000 & house blw.med." 		if groupstr=="test_id_6&house_belmed&everyonex3=1"
replace groupstr="appl.year 2000 & house abv.med." 		if groupstr=="test_id_6&house_abvmed&everyonex3=1"
replace groupstr="appl.year 2000 & no commuter" 		if groupstr=="test_id_6&commuter_0&everyonex3=1"
replace groupstr="appl.year 2000 & commuter" 			if groupstr=="test_id_6&commuter_1&everyonex3=1"
replace groupstr="appl.year 2000 & not enr.2005" 		if groupstr=="test_id_6&enr2005_0&everyonex3=1"
replace groupstr="appl.year 2000 & enr.2005" 			if groupstr=="test_id_6&enr2005_1&everyonex3=1"

}


tostring N, replace
replace groupstr=groupstr+" (N="+N+")"
labmask group, values(groupstr)

